/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package info.touret.winecellar.test;

import com.google.inject.Provider;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;

/**
 *
 * @author touret-a
 */
public class ValidatorProvider implements Provider<Validator> {

    @Override
    public Validator get() {
        Validator validator = null;
        try {
            ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
            validator = factory.getValidator();
        } catch (Exception e) {
            Logger.getLogger(ValidatorProvider.class.getName()).log(Level.SEVERE, null, e);
        }
        return validator;
    }
}
